-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Create UserCreationService
and use in API V1 create user endpoint
#19150
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
identityProvider?: IdentityProvider; | ||
} | ||
|
||
export class UserCreationService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly what we are looking for with application services coordinating these calls. Very nice.
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (02/10/25)1 reviewer was added to this PR based on Keith Williams's automation. |
E2E results are ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Will you also make these changes in packages/features/auth/lib/next-auth-options.ts in a follow up PR?
@Udit-takkar I have this PR in the stack that addresses this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. works fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the tests! Great stuff! Just have 2 comments below:
const log = logger.getSubLogger({ prefix: ["[userCreationService]"] }); | ||
|
||
export class UserCreationService { | ||
static async createUser({ data }: { data: CreateUserInput }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not directly pass CreateUserInput
to the createUser
function?
static async createUser(data: CreateUserInput) {}
username: slugify(username), | ||
organizationId: organizationId, | ||
uid: ProfileRepository.generateProfileUid(), | ||
organizationId: organizationIdValue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are creating a profile but shouldn't we also create a user membership for the org? I think that org users have both membership and profile.
@supalarry to address your feedback, I have a PR stack where I handle org creation logic #19201 This addresses your comments:
|
527539e
What does this PR do?
UserCreationService
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist